﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Shove.Web.UI;

public partial class UserControls_HotGood2 : UCBase
{
    public UserControls_HotGood2()
    {
        Name = "今日热点2";

        swpas = new ShoveWebPartAttribute[8];

        swpas[0] = new ShoveWebPartAttribute_Int("控件宽度", "1,1000", 200, "控件宽度");
        swpas[1] = new ShoveWebPartAttribute_Int("控件高度", "1,600", 130, "控件高度");
        swpas[2] = new ShoveWebPartAttribute_Image("今日热点导航图片宽度", "1,500", 91, "今日热点导航图片宽度");
        swpas[3] = new ShoveWebPartAttribute_Image("今日热点导航图片高度", "1,500", 27, "今日热点导航图片高度");
        swpas[4] = new ShoveWebPartAttribute_Image("今日热点导航图片", "", "images/jrrm.gif", "今日热点导航图片");
        swpas[5] = new ShoveWebPartAttribute_Color("控件边框颜色", "#eaeaea", "控件边框颜色");
        swpas[6] = new ShoveWebPartAttribute_Color("今日热点底部边框颜色", "#eaeaea", "今日热点底部边框颜色");
        swpas[7] = new ShoveWebPartAttribute_Text("热点名的CSS样式", "", "hot", "热点名的CSS样式");
    }

    private void Initlayout()
    {
        tabctr.Width = swpAttributes[0];
        tabctr.BorderColor = swpAttributes[5];
        tabctr.Height = swpAttributes[1];

        img.Src = "~/" + swpAttributes[4];
        img.Width = Shove._Convert.StrToInt(swpAttributes[2], 91);
        img.Height = Shove._Convert.StrToInt(swpAttributes[3], 27);
        span1.Style.Add("border-bottom-color",swpAttributes[6]);
        tdName.Attributes.Add("class", swpAttributes[7]);
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Initlayout();
            this.BindData();
        }
    }

    private void BindData()
    {
        Repeater1.DataSource = new DAL.Tables.tbl_Site_HotSpot().Open("", "", "");
        Repeater1.DataBind();
    }
}
